package com.yanqu.road.server.manger.config;

import com.yanqu.road.entity.config.beauty.BeautyInfo;
import com.yanqu.road.entity.config.promotion.PromotionInfo;
import com.yanqu.road.entity.config.skill.SkillInfo;
import com.yanqu.road.entity.config.skill.SkillUpgradeInfo;
import com.yanqu.road.entity.enums.ePatronsSkillType;
import com.yanqu.road.entity.enums.eSkillType;
import com.yanqu.road.entity.player.*;
import com.yanqu.road.logic.bussiness.config.SkillBussiness;
import com.yanqu.road.server.TempMgr;
import com.yanqu.road.server.protocol.GameErrorCode;
import com.yanqu.road.utils.property.Property;

import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;

/**
 * 技能信息管理
 */
public class SkillMgr extends TempMgr {

    private static Map<Integer, SkillInfo> skillInfoMap;

    private static Map<Integer, Map<Integer, SkillUpgradeInfo>> skillUpgradeInfoMap;

    private static  Map<Integer, List<SkillInfo>> skillInfoTypeListMap;

    private static Map<Integer, SkillInfo> kowloonSkillInfoMap = new HashMap<>(); //卖鱼佬专用技能

    public static int getSkillMaxLvByUpgradeType(int type) {
        int maxLv = 0;
        List<SkillUpgradeInfo> skillUpgradeInfoList = getSkillUpgradeInfoList(type);
        for (SkillUpgradeInfo info : skillUpgradeInfoList) {
            if (maxLv < info.getLevel()) {
                maxLv = info.getLevel();
            }
        }
        return maxLv;
    }

    @Override
    public boolean init() throws Exception {
        return reload();
    }

    @Override
    public boolean stop() {
        return false;
    }

    @Override
    public boolean save() {
        return false;
    }

    @Override
    public boolean reloadConfig() {
        skillInfoMap = SkillBussiness.getSkillInfoMap();
        skillUpgradeInfoMap = SkillBussiness.getSkillUpgradeInfoMap();
        loadSkillTypeConsumeMap();
        initKowloonSkill();
        return true;
    }

    public void loadSkillTypeConsumeMap() {
        Map<Integer, List<SkillInfo>> _skillInfoTypeList = new HashMap<>();
        skillInfoMap.forEach((k, v) -> {
            if (!_skillInfoTypeList.containsKey(v.getType())) {
                _skillInfoTypeList.put(v.getType(), new ArrayList<>());
            }
            _skillInfoTypeList.get(v.getType()).add(v);
        });

        for (Map.Entry<Integer, List<SkillInfo>> listEntry : _skillInfoTypeList.entrySet()) {
            List<SkillInfo> sortedList = listEntry.getValue().stream().sorted(Comparator.comparingInt(SkillInfo::getId)).collect(Collectors.toList());
            listEntry.setValue(sortedList);
        }
        skillInfoTypeListMap = _skillInfoTypeList;
    }

    public void initKowloonSkill(){
        for (SkillInfo skillInfo : skillInfoMap.values()) {
            if (skillInfo.getType() == eSkillType.KowloonSkill174.getValue() ||
                    skillInfo.getType() == eSkillType.KowloonSkill175.getValue() ||
                    skillInfo.getType() == eSkillType.KowloonSkill176.getValue() ||
                    skillInfo.getType() == eSkillType.KowloonSkill177.getValue() ||
                    skillInfo.getType() == eSkillType.KowloonSkill178.getValue() ||
                    skillInfo.getType() == eSkillType.KowloonSkill179.getValue() ||
                    skillInfo.getType() == eSkillType.KowloonSkill180.getValue() ||
                    skillInfo.getType() == eSkillType.KowloonSkill181.getValue() ||
                    skillInfo.getType() == eSkillType.KowloonSkill182.getValue() ||
                    skillInfo.getType() == eSkillType.KowloonSkill183.getValue() ||
                    skillInfo.getType() == eSkillType.KowloonSkill184.getValue() ||
                    skillInfo.getType() == eSkillType.KowloonSkill185.getValue() ||
                    skillInfo.getType() == eSkillType.KowloonSkill186.getValue() ||
                    skillInfo.getType() == eSkillType.KowloonSkill187.getValue() ||
                    skillInfo.getType() == eSkillType.KowloonSkill188.getValue() ||
                    skillInfo.getType() == eSkillType.KowloonSkill189.getValue() ||
                    skillInfo.getType() == eSkillType.KowloonSkill190.getValue() ||
                    skillInfo.getType() == eSkillType.KowloonSkill191.getValue() ||
                    skillInfo.getType() == eSkillType.KowloonSkill192.getValue() ||
                    skillInfo.getType() == eSkillType.KowloonSkill193.getValue() ||
                    skillInfo.getType() == eSkillType.KowloonMorale.getValue() ||
                    skillInfo.getType() == eSkillType.KowloonSkill196.getValue() ||
                    skillInfo.getType() == eSkillType.KowloonSkill197.getValue() ||
                    skillInfo.getType() == eSkillType.KowloonSkill199.getValue()
            ) {
                kowloonSkillInfoMap.put(skillInfo.getId(), skillInfo);
            }
        }
    }


    @Override
    public boolean reloadData() throws Exception {
        return true;
    }

    public static SkillInfo getSkillInfo(int skillId){
        return skillInfoMap.get(skillId);
    }

    //获取指定升级类型的当前等级的升级消耗
    public static ReturnData getUpgradeConsume(int upgradeType, int curLv) {

        //下一等级的升级参数 获取用来判断 不存在则已经满级
        SkillUpgradeInfo nextSkillUpgradeInfo = SkillMgr.getSkillUpgradeInfo(upgradeType, curLv + 1);

        //当前等级的升级参数
        SkillUpgradeInfo skillUpgradeInfo = SkillMgr.getSkillUpgradeInfo(upgradeType, curLv);
        if (nextSkillUpgradeInfo == null || skillUpgradeInfo == null) {
            return new ReturnData(GameErrorCode.E_UPGRADE_LEVEL_MAX);
        }
        return new ReturnData(0, String.valueOf(skillUpgradeInfo.getConsumeCount()));
    }

    /**
     * 是否区间配置的升级方式,之前一级一条的配置,后面有改成区间配置的放这里面
     *
     * @param upgradeType
     * @return
     */
    public static boolean isNewSectionUpgradeType(int upgradeType) {
        if (upgradeType == 150 || upgradeType == 195 || upgradeType == 196) {
            return true;
        }
        if (upgradeType >= 201) {
            return true;
        }

        return false;
    }

    public static SkillUpgradeInfo getSkillUpgradeInfo(int upgradeType, int level) {
        if (isNewSectionUpgradeType(upgradeType)) {//兰飞鸿信物技能升级类型,不是一级一条数据
            if (!skillUpgradeInfoMap.containsKey(upgradeType)) {
                return null;
            }
            List<SkillUpgradeInfo> list = new ArrayList<>(skillUpgradeInfoMap.get(upgradeType).values());
            list.sort(Comparator.comparing(SkillUpgradeInfo::getLevel));

            SkillUpgradeInfo takeUpgradeInfo = null;
            for (SkillUpgradeInfo upgradeInfo : list) {
//                if (takeUpgradeInfo == null) {
//                    takeUpgradeInfo = upgradeInfo;
//                }
                if (upgradeInfo.getLevel() > level) {
                    break;
                }
                takeUpgradeInfo = upgradeInfo;
            }
            return takeUpgradeInfo;

        } else {
            if (skillUpgradeInfoMap.containsKey(upgradeType)) {
                return skillUpgradeInfoMap.get(upgradeType).get(level);
            }
        }
        return null;
    }

    public static List<SkillUpgradeInfo> getSkillUpgradeInfoList(int upgradeType) {
        List<SkillUpgradeInfo> skillUpgradeInfos = new ArrayList<>();
        if (skillUpgradeInfoMap.containsKey(upgradeType)) {
            skillUpgradeInfos = new ArrayList<>(skillUpgradeInfoMap.get(upgradeType).values());
        }
        if (skillUpgradeInfos.size() > 0) {
            skillUpgradeInfos.sort(Comparator.comparing(SkillUpgradeInfo::getLevel));
        }
        return skillUpgradeInfos;
    }

    //初始化钱庄信誉等级对应的技能
    public static Map<Integer, Map<Integer, Integer>> initHouseSkillAdditionMap(List<Integer> skillList){
        Map<Integer, Map<Integer, Integer>> additionMap = new ConcurrentHashMap<>();
        for(Integer skillId : skillList){
            SkillInfo skillInfo = getSkillInfo(skillId);
            if(null == skillInfo){
                continue;
            }
            if(!additionMap.containsKey(skillInfo.getType())){
                additionMap.put(skillInfo.getType(), new ConcurrentHashMap<>());
            }
            int param3 = skillInfo.getParamList().get(2);
            int addition = 0;
            if(additionMap.get(skillInfo.getType()).containsKey(param3)){
                addition = additionMap.get(skillInfo.getType()).get(param3);
            }
            //钱庄技能都是1级
            addition += getSkillAddition(skillInfo, 1);
            additionMap.get(skillInfo.getType()).put(param3, addition);
        }
        return additionMap;
    }

    public static Map<Integer, Map<Integer, Integer>> initIdentitySkillAdditionMap(Map<Integer, UserBeauty> beautyMap){
        Map<Integer, Map<Integer, Integer>> additionMap = new ConcurrentHashMap<>();
        for(UserBeauty userBeauty : beautyMap.values()){
            BeautyInfo beautyInfo = BeautyMgr.getBeautyInfo(userBeauty.getBeautyId());
            SkillInfo skillInfo = getSkillInfo(beautyInfo.getIdentitySkillId());
            if(null == skillInfo){
                continue;
            }
            if(!additionMap.containsKey(skillInfo.getType())){
                additionMap.put(skillInfo.getType(), new ConcurrentHashMap<>());
            }
            int param3 = skillInfo.getParamList().get(2);
            int addition = 0;
            if(additionMap.get(skillInfo.getType()).containsKey(param3)){
                addition = additionMap.get(skillInfo.getType()).get(param3);
            }
            addition += getSkillAddition(skillInfo, userBeauty.getIdentitySkillLv());
            additionMap.get(skillInfo.getType()).put(param3, addition);
        }
        return additionMap;
    }

    public static Map<Integer, Map<Integer, Integer>> initTalentSkillAdditionMap(Map<Integer, UserPatrons> patronsMap){
        Map<Integer, Map<Integer, Integer>> additionMap = new ConcurrentHashMap<>();
        for(UserPatrons userPatrons : patronsMap.values()){
            for(UserPatronsSkill patronsSkill : userPatrons.getSkillList()){
                if(patronsSkill.getType() != ePatronsSkillType.Talent.getValue()){
                    continue;
                }
                SkillInfo skillInfo = getSkillInfo(patronsSkill.getSkillId());
                if(null == skillInfo){
                    continue;
                }
                if(!additionMap.containsKey(skillInfo.getType())){
                    additionMap.put(skillInfo.getType(), new ConcurrentHashMap<>());
                }
                int param3 = skillInfo.getParamList().get(2);
                int addition = 0;
                if(additionMap.get(skillInfo.getType()).containsKey(param3)){
                    addition = additionMap.get(skillInfo.getType()).get(param3);
                }
                addition += getSkillAddition(skillInfo, patronsSkill.getSkillLv());
                additionMap.get(skillInfo.getType()).put(param3, addition);
            }

            if (userPatrons.getLeaderPromotionId() > 0) {//凤魁的晋升,拿凤魁对应的天赋
                PromotionInfo promotionInfo = PromotionMgr.getPromotionInfoById(userPatrons.getLeaderPromotionId());
                if (promotionInfo != null) {
                    for (Integer skillId : promotionInfo.getTalentList()) {
                        SkillInfo skillInfo = getSkillInfo(skillId);
                        if(null == skillInfo){
                            continue;
                        }

                        int skillLv = userPatrons.getCombLeaderSkillLv(skillId);
                        if (skillLv <= 0) {
                            continue;
                        }

                        if(!additionMap.containsKey(skillInfo.getType())){
                            additionMap.put(skillInfo.getType(), new ConcurrentHashMap<>());
                        }
                        int param3 = skillInfo.getParamList().get(2);
                        int addition = 0;
                        if(additionMap.get(skillInfo.getType()).containsKey(param3)){
                            addition = additionMap.get(skillInfo.getType()).get(param3);
                        }
                        addition += getSkillAddition(skillInfo, skillLv);
                        additionMap.get(skillInfo.getType()).put(param3, addition);
                    }
                }
            }
        }
        return additionMap;
    }

    public static Map<Integer, Map<Integer, Integer>> initVehicleTalentSkillAdditionMap(Map<String, UserVehicle> vehicleMap){
        Map<Integer, Map<Integer, Integer>> additionMap = new ConcurrentHashMap<>();
        for(UserVehicle vehicle : vehicleMap.values()){
            for (int i = 0; i < vehicle.getOtherSkillList().size(); i++) {
                UserVehicleOtherSkill otherSkill = vehicle.getOtherSkillList().get(i);
                SkillInfo skillInfo = getSkillInfo(otherSkill.getSkillId());
                if(null == skillInfo){
                    continue;
                }
                if(!additionMap.containsKey(skillInfo.getType())){
                    additionMap.put(skillInfo.getType(), new ConcurrentHashMap<>());
                }
                int param3 = skillInfo.getParamList().get(2);
                int addition = 0;
                if(additionMap.get(skillInfo.getType()).containsKey(param3)){
                    addition = additionMap.get(skillInfo.getType()).get(param3);
                }
                addition += getSkillAddition(skillInfo, otherSkill.getSkillLv());
                additionMap.get(skillInfo.getType()).put(param3, addition);
            }

        }
        return additionMap;
    }

    public static int getSkillAdditionFromMap(int skillType, int param, Map<Integer, Map<Integer, Integer>> skillAdditionMap){
        Map<Integer, Integer> typeMap = skillAdditionMap.get(skillType);
        if(null == typeMap){
            return 0;
        }
        int addition = 0;
        if(typeMap.containsKey(0)){
            addition = typeMap.get(0);
        }
        if(param > 0 && typeMap.containsKey(param)){
            addition += typeMap.get(param);
        }
        return addition;
    }

    /**
     * 获取美名技能加成
     */
    public static int getIdentitySkillAddition(Map<Integer, UserBeauty> beautyMap, int skillType, int param){
        Map<Integer, Map<Integer, Integer>> skillAdditionMap = initIdentitySkillAdditionMap(beautyMap);
        return getSkillAdditionFromMap(skillType, param, skillAdditionMap);
    }

    /**
     * 获取天赋技能加成
     */
    public static int getTalentSkillAddition(Map<Integer, UserPatrons> patronsMap, int skillType, int param){
        Map<Integer, Map<Integer, Integer>> skillAdditionMap = initTalentSkillAdditionMap(patronsMap);
        return getSkillAdditionFromMap(skillType, param, skillAdditionMap);
    }

    //是不是门客的蛐蛐缘分技能
    public static boolean isPatronsCricketFateSkill(int skillId){
        if(skillId >= 632501 && skillId <= 632505){
            return true;
        }
        return false;
    }

    public static int getSkillAddition(SkillInfo skillInfo, int skillLv){
        int addition = 0;
        if(0 >= skillLv){
            return addition;
        }
        if(eSkillType.Ability.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        }else if(eSkillType.Qualification.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        }else if(eSkillType.DispatchEarn.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        }else if(eSkillType.BattleEffect.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        }else if(eSkillType.ChildEarnSpeed.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        }else if(eSkillType.MineOutput.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        }else if(eSkillType.BeautyExp.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        }else if(eSkillType.StaffRecruitCost.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        }else if(eSkillType.BeLike.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        }else if(eSkillType.PassBattleCost.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        }else if(eSkillType.TradeWarScoreItem.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        }else if(eSkillType.VehicleLevel.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        }else if(eSkillType.VehicleStudyLv.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        }else if(eSkillType.TravelAddPrestige.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        }else if(eSkillType.BuildingLevel.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        }else if(eSkillType.PassBossBuyBuffCost.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        }else if(eSkillType.LonelyEarnSpeedAddition.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        }else if(eSkillType.ChildTrainAddPatronsExp.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        }else if(eSkillType.BeautyTrystAddBeautyExp.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        }else if(eSkillType.MineWarAddOutput.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        }else if(eSkillType.TradeWarAddMyScore.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        }else if(eSkillType.TradeWarEnemyLoseScore.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        }else if(eSkillType.HuntAddPatronsBattleTimes.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        }else if(eSkillType.SacrificeAddDamage.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        }else if(eSkillType.TradeWarAddScore.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        }else if(eSkillType.BeautyPatronsSkill1.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1) + (skillLv - 1)*(skillLv - 2)*skillInfo.getUpgradeParamList().get(2)/2);
        }else if(eSkillType.BeautyPatronsSkill2.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1) + (skillLv - 1)*(skillLv - 2)*skillInfo.getUpgradeParamList().get(2)/2);
        }else if(eSkillType.BeautyBanquetPopularitySkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        }else if(eSkillType.BanquetJoinPopularitySkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        }else if(eSkillType.TravelPowerGiftLimitAdd.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        }else if(eSkillType.CommonActivityScoreAddition.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        }else if(eSkillType.ChildEarnSpeedSexAddition.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        }else if(eSkillType.ChildTrainAddPatronsExpSexAddition.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        }else if(eSkillType.TrainCasinoDiceWin.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        }else if(eSkillType.AddPatronsAbility.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        } else if (eSkillType.AddChildAbility.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        } else if (eSkillType.SkinAddIntimacy.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        } else if (eSkillType.SkinAddGlamour.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        } else if (eSkillType.AddPatronsAbilityByOccupation.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        } else if (eSkillType.HuaShiGangDamageAddition.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        } else if (eSkillType.SonHaiPowerAddition.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        } else if (eSkillType.PatronsCookSkill.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1) + (skillLv - 1)*(skillLv - 2)/2*skillInfo.getUpgradeParamList().get(2));
        }else if (eSkillType.VehicleCombSkill.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        } else if (eSkillType.StrongholdAdditionSkill.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        } else if (eSkillType.StrongholdEliminateAdditionSkill.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        } else if (eSkillType.DafuwengAddPatronsDamage.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        } else if (eSkillType.SkinAddAllIntimacy.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        } else if (eSkillType.SkinAddAllGlamour.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        } else if (eSkillType.ClinicDiseaseEarnSpeedAddition.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        } else if (eSkillType.ShuiHuRecycleCardAddition.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        } else if (eSkillType.HuaShiGangBossDamageAddition.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        } else if (eSkillType.TradeWarLoseScoreReduce.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        } else if (eSkillType.GhostAttackAddition.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        } else if (eSkillType.GhostTalentAttackAddition.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        } else if (eSkillType.CrossUnionWarLianShengTimesAddition.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        } else if (eSkillType.CrossUnionWarAbilityAddition.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        } else if (eSkillType.HuaShiGangBattleDamageAddition.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        } else if (eSkillType.SkinVolumePatronsQualificationAddition.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        } else if (eSkillType.SkinVolumeBeautyIntimacyAddition.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        } else if (eSkillType.SkinVolumeBeautyGlamourAddition.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        } else if (eSkillType.SkinVolumePatronsLvLimitAddition.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        } else if (eSkillType.ManorOutPutAddition.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        } else if (eSkillType.ManorBuildingStaffEarnAddition.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        } else if (eSkillType.ManorBuildingEarnAddRatio.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        } else if (eSkillType.ManorPatronsAbilityAddValue.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        } else if (eSkillType.ManorPatronsQualificationAddValue.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        } else if (eSkillType.ManorBeautyGlamourAddValue.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        } else if (eSkillType.ManorBuildingTypeEarnAddRatio.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        } else if (eSkillType.ManorBeautyIntimacyAddValue.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        }else if(eSkillType.BeautyPatronsEscortSkill1.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1) + (skillLv - 1)*(skillLv - 2)*skillInfo.getUpgradeParamList().get(2)/2);
        }else if(eSkillType.BeautyPatronsEscortSkill2.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1) + (skillLv - 1)*(skillLv - 2)*skillInfo.getUpgradeParamList().get(2)/2);
        } else if (eSkillType.DunHuangShiKuBloodAddRatio.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        } else if (eSkillType.DunHuangShiKuAttackAddRatio.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        } else if (eSkillType.ZsSeatAddition.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        } else if (eSkillType.BeautyEscortFreeTimesAddition.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        } else if (eSkillType.CombPatronsEarnSpeedAddition.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        } else if (eSkillType.CombPatronsQualificationAddition.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        } else if (eSkillType.ZsOpenAddition.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        } else if (eSkillType.SpecialOccupationPatronsAbilityAddRatio.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        } else if (eSkillType.WineShopOccupationBeautyIntimacyAdd.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        } else if (eSkillType.WineShopOccupationBeautyGlamourAdd.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        } else if (eSkillType.WineShopPatronsBaiYeExpAdd.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        } else if (eSkillType.WineShopBeautyEscortExpAdd.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        } else if (eSkillType.SpecialPatronsQualificationAddition.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        } else if (eSkillType.CALABASH_BROTHERS_QUEEN.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        } else if (eSkillType.CALABASH_BROTHERS_KING.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        } else if (eSkillType.FishPondStageSkillMaxLevelAdd.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        } else if (eSkillType.SkinBeautySkillAddPatronsAbility.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        } else if (eSkillType.SkinBeautySkillAddPatronsAbilityAddition.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        } else if (eSkillType.SkinPatronsSkillAddPatronsQualification.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        } else if (eSkillType.PatronsNewCombSkill.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        } else if (eSkillType.SeacraftPirateRiotAtkAddi.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        } else if (eSkillType.WingRoomComfortValueAdd.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        } else if (eSkillType.SkillMaxLevelAdd.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        } else if (eSkillType.UnionFlagAddEarnSpeed.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(1);
        } else if (eSkillType.DrugStoreBuildingEarnSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        }  else if (eSkillType.DrugStorePatronsStageLvLimitSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        } else if (eSkillType.DrugStoreDrugTechSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        } else if (eSkillType.TongBingTeamMaxSoldierAddi.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        } else if (eSkillType.ChuHanTeamMaxSoldierAddi.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        } else if (eSkillType.SuiTangTeamMaxSoldierAddi.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        }
        else if (eSkillType.WineryTradeWarAddition.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        }
        else if (eSkillType.WineryCalabashAddition.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        }
        else if (eSkillType.WineryHomeAddition.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        }
        else if (eSkillType.PatronsDispatchBuildingAddition.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        }
        else if (eSkillType.PatronsDispatchRankUnionWarAddition.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        }
        else if (eSkillType.TombAddPlayerAck.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        }
        else if (eSkillType.TombAddPlayerHp.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        }
        else if (eSkillType.XiaoXiongPatronHalo.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        }
        else if (eSkillType.GrandChildQualityWeightAddition.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        } else if (eSkillType.CricketSkillMaxLevel.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        }
        else if (eSkillType.BankSkillShopAdd.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        }
        else if (eSkillType.StrangePatronHalo.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        }
        else if (eSkillType.PatronsCricketSkillLevelAddition.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        } else if (eSkillType.BeautyPeerlessSkillAddition.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        }else if (eSkillType.FiveHeroSkillAddition.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        }else if(eSkillType.PatronsKeepSakeLinkAddtition.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        }else if(eSkillType.ZhangQiLingSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        } else if(eSkillType.SpecialPatronsEarnAddition.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        } else if(eSkillType.CurioBeautyGlamourSkill.getValue() == skillInfo.getType()){
            //=======================藏宝开始
            //注意，藏宝都是参数4
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.CurioPatronsAbilitySkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.CurioOccupationBuildingEarnSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.CurioBuildingEarnSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.CurioBuildingStaffSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.CurioBeautyTalkExpSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.CurioNewMonopolyGuanYinSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.CurioNewMonopolyPatronsSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.CurioNewMonopolyBeautySkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.CurioZSOpenTimeSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.CurioZSTokenSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.CurioTradeWarSelfAddSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.CurioTradeWarOpponentAddSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.CurioOpenBanquetPopularitySkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.CurioJoinBanquetPopularitySkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.CurioCookAddSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.CurioMonthCardIngotsAddSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.CurioYearCardIngotsAddSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.CurioRankLikeIngotsAddSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.CurioMammonLikeIngotsAddSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.CurioTitleRewardIngotsAddSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.CurioTravelGiveAddSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.CurioTravelGetAddSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.CurioTravelPrestigeAddSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.CurioBeautyEnergyAddSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.CurioBeautyEnergyLimitAddSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.CurioChildAdultAddSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.CurioPatronsQualificationSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.CurioPatronsEarnAddSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.CurioPeerlessPatronsEarnAddSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.CurioComPatronsEarnAddSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.BeautyIntimacyAddSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.VehicleAwakenLimitAddSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.PeerlessPatronsQualificationAddSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.OccupationSoulStoneAddSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.SpecialBuildingStaffRecruitNumAddSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.VehicleLevelLimitAddSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.SpecialPatronsEarnAddSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.CurioSuiTangTeamMaxSoldierAdd.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.SpecialOccupationBeautyEscortSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.SpecialOccupationChildPatronsExpSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.KuangBattleBuildTimesSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.KuangBattleAttackSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.KuangBattleHpSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.UnionCampWarSendTimesSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.UnionCampWarPatronsEarnSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.DunHuangAttackBloodSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.TombAttackBloodSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.SeacraftAttackSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.FiveHeroAttackSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.HuaShiGangPatronsSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.GhostPatronsSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.StrongholdWarPatronsSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.DaFuWengBattleDamageSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.TongBingSoldierSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.ClinicScoreSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.DrugStoreTongBiSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.WineShopMoneySkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.WineryAromaSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.ManorAnimalOutputSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.CurioPassBattleCostSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.PassPatronsExpOutputSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.PassPrestigeOutputSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.PassBattleEarnSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.PassEventNumSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.ChildEnergyRecoverySkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.ChildEnergyLimitSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.ChildUnMarriageLimitSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.ChildLonelyEarnSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.OccupationPatronsQualificationAddSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.CurioBeautyIntimacyAdd.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.CurioBeautyGlamourAdd.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
        } else if(eSkillType.CurioAddCricketPatronsSkillMaxSkill.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(3);
            addition += (skillInfo.getUpgradeParamList().get(3) * (skillLv - 1));
            //=======================藏宝结束
        } else if(eSkillType.FoxSkill204.getValue() == skillInfo.getType()){
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        } else if (eSkillType.FoxSkill205.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        } else if (eSkillType.Skill248.getValue() == skillInfo.getType() || eSkillType.Skill249.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        } else if (eSkillType.CombLeaderSkill208.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        } else if (eSkillType.CurioSkill334.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        } else if (eSkillType.CurioSkill335.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        } else if (eSkillType.TravelAlbumEarnSpeedQuality.getValue() == skillInfo.getType()
                || eSkillType.TravelCardEarnSpeedFixedValue.getValue() == skillInfo.getType()
                || eSkillType.TravelCardEarnSpeedQuality.getValue() == skillInfo.getType()
                || eSkillType.TravelCardEarnSpeedPerm.getValue() == skillInfo.getType()
                || eSkillType.TravelCardBeautyIntimacy.getValue() == skillInfo.getType()
                || eSkillType.TravelCardBeautyGlamour.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(0);
            addition += (skillInfo.getUpgradeParamList().get(0) * (skillLv - 1));
        } else if (eSkillType.PatronsSkillCommonAbility.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(1);
            addition += (skillInfo.getUpgradeParamList().get(1) * (skillLv - 1));
        }
        return addition;
    }

    /**
     * 根据索引下表获取技能等级增加的属性
     *
     * @param skillInfo 技能
     * @param skillLv 等级
     * @param idx 索引下表
     * @return 增加的属性
     */
    public static int getSkillAddition(SkillInfo skillInfo, int skillLv, int idx) {
        int addition = 0;

        if (0 >= skillLv) {
            return addition;
        }

        if (eSkillType.TravelCardBeautyIntimacy.getValue() == skillInfo.getType()
                || eSkillType.TravelCardBeautyGlamour.getValue() == skillInfo.getType()) {
            addition = skillInfo.getParamList().get(idx);
            addition += (skillInfo.getUpgradeParamList().get(idx) * (skillLv - 1));
        }

        return addition;
    }
    /**
     * 门客、美女皮肤的技能升级特殊性获取
     * @param upgradeType
     * @param level
     * @return
     */
    public static SkillUpgradeInfo getSkillUpgradeInfoIfNotGetMax(int upgradeType, int level) {
        SkillUpgradeInfo skillUpgradeInfo = getSkillUpgradeInfo(upgradeType, level);
        if(null == skillUpgradeInfo){
            int maxLv = 0;
            Map<Integer, SkillUpgradeInfo> dataMap = skillUpgradeInfoMap.get(upgradeType);
            if(null != dataMap){
                for(SkillUpgradeInfo data : dataMap.values()){
                    if(data.getLevel() > maxLv && data.getLevel() <= level){
                        maxLv = data.getLevel();
                        skillUpgradeInfo = data;
                    }
                }
            }
        }
        return skillUpgradeInfo;
    }

    public static SkillInfo getSkillWith(int skillType, int  consumeItemId) {
        List<SkillInfo> list = skillInfoTypeListMap.get(skillType);
        if (list == null) {
            return null;
        }
        return list.stream().filter(v -> {
            if (v.getConsumeGoodsId().size() != 1) {
                return false;
            }
            return v.getConsumeGoodsId().get(0) == consumeItemId;
        }).findFirst().orElse(null);
    }

    /**
     * 获取当前等级升至满级所需要的消耗
     */
    public static long getTotalConsumeOfSkillUpgradeMaxLevel(int upgradeType, int curLv) {
        // 获取满级
        int maxLv = getSkillMaxLvByUpgradeType(upgradeType);
        long totalConsume = 0;
        while (curLv < maxLv) {
            SkillUpgradeInfo skillUpgradeInfo = getSkillUpgradeInfo(upgradeType, curLv);
            if (skillUpgradeInfo == null) {
                break;
            }
            totalConsume += skillUpgradeInfo.getConsumeCount();
            curLv++;
        }
        return totalConsume;
    }

    public static List<SkillInfo> getSkillInfoListByType(int skillType) {
        return skillInfoTypeListMap.get(skillType);
    }

    public static Map<Integer, SkillInfo> getKowloonSkillInfoMap() {
        return kowloonSkillInfoMap;
    }

    /**
     * 获取技能到{currentLevel}等级，需要消耗的道具数量
     * @param skillId
     * @param currentLevel
     * @return
     */
    public static int getSkillConsumeByLevel(int skillId, int currentLevel) {
        if (currentLevel == 1) {
            return 0;
        }
        int allConsume = 0;
        Map<Integer, SkillUpgradeInfo> skillUpgradeMap = skillUpgradeInfoMap.get(skillId);
        for (Map.Entry<Integer, SkillUpgradeInfo> entry : skillUpgradeMap.entrySet()) {
            SkillUpgradeInfo skillUpgradeInfo = entry.getValue();
            if (skillUpgradeInfo != null && skillUpgradeInfo.getLevel() < currentLevel) {
                allConsume += skillUpgradeInfo.getConsumeCount();
            }
        }
        return allConsume;
    }

    /**
     * 获得指定技能对应等级的总消耗
     */
    public static Property calcSkillLvTotalConsume(int skillId, int startLv, int endLv, int upgradeIdx) {
        Property consume = new Property();
        SkillInfo skillInfo = SkillMgr.getSkillInfo(skillId);
        if (skillInfo == null) {
            return consume;
        }

        for (int lv = startLv; lv < endLv; lv++) {
            SkillUpgradeInfo skillUpgradeInfo = SkillMgr.getSkillUpgradeInfo(skillInfo.getUpgradeType(upgradeIdx), lv);
            if (skillUpgradeInfo == null) {
                continue;
            }
            consume.addProperty(new Property(skillInfo.getConsumeGoodsId().get(upgradeIdx), skillUpgradeInfo.getConsumeCount()));
        }
        return consume;
    }
}
